<?php


namespace app\index\validate;


use think\Validate;

class memberInfo extends Validate
{
    protected $rule = [
        'id'=>'require',
//        member
        'phone'=>'require|mobile|unique:member',
        'code'=> 'require',
        'password'=> 'require',
        'captcha'=> 'require',
//       memberInfo
        'name'=> 'require',
        'member_id'=> 'require|unique:member_info',
        'company_time'=> 'require',
        'fund'=> 'require',
        'address'=> 'require',
        'home_address'=> 'require',
        'contacts'=> 'require',
        'position'=> 'require',
        'landine_phone'=> 'require',
        'mobile'=> 'require|mobile',
        'email'=> 'require|email',
        'wechat'=> 'require',
        'phone_set' => 'require|mobile',
        'trade_name' => 'require',
        'budget' => 'require',
        'shipment' => 'require',
        'line' => 'require',
        'service_content' => 'require',
        'self_car' => 'require',
        'subordinate_car' => 'require',
        'self_buying' => 'require',
        'subordinate_buying' => 'require',
        'certification' => 'require',
        'case' => 'require'
    ];
    protected $message = [
        'id'=>'传入的ID为空',
//        member
        'phone' => '手机号不能为空',
        'phone.mobile' => '请输入正确的手机号',
        'phone.unique' => '手机号已注册',
        'code'=> '请输入手机验证码',
        'password'=> '请输入密码',
        'captcha'=> '图形验证码不能为空',
//        memberInfo
        'name' => '公司名称不能为空',
        'member_id' => '未注册无法认证',
        'member_id.unique' => "不要重复认证或者提交",
        'summary'=>'注册时间不能为空',
        'fund'=>'注册资金不能为空',
        'address'=>'归属地不能为空',
        'home_address'=>'详细地址不能为空',
        'contacts'=>'联系人不能为空',
        'position'=>'职位不能为空',
        'landine_phone'=>'座机不能为空',
        'mobile'=>'手机号不能为空',
        'mobile.mobile'=>'填写正确的手机号',
        'email'=>'邮箱不能为空',
        'email.email'=>'填写正确的邮箱',
        'wechat'=>'微信不能为空',
        'phone_set' => '手机号不能为空',
        'phone_set.mobile' => '请输入正确的手机号',
        'trade_name' => '所属行业或者服务不能为空',
        'budget' => '预算金额不能为空',
        'shipment' => '发货量不能为空',
        'line' => '路线不能为空',
        'service_content' => '服务要求不能为空',
        'self_car' => '自有运力不能为空',
        'subordinate_car' => '外协车辆不能为空',
        'self_buying' => '自购占比不能为空',
        'subordinate_buying' => '挂靠占比不能为空',
        'certification' => '资质不能为空',
        'case' => '案例不能为空'
    ];

    protected $scene = [
        'memberInfo_add'=>['name','summary','fund','address','home_address','contacts','position','landine_phone','mobile','email','wechat'],
        'logisticsInfo_add'=>['name','summary','fund','address','home_address','contacts','position','landine_phone','mobile','email','wechat'],
        'member_send_code' => ['phone'],
        'member_add' => ['phone','code','password'],
        'member_login' => ['phone','password'],
        'member_change_password' => ['phone_set'],
        'member_change_check' => ['phone_set','code'],
        'consignor_add' => ['trade_name','budget','shipment','line','service_content'],
        'logistics_add' => ['trade_name','self_car','subordinate_car','line','self_buying','subordinate_buying','certification','case'],
        ];
}